<?xml version='1.0' encoding='UTF-8' ?>

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:fn="http://java.sun.com/jsp/jstl/functions"
                xmlns:h="http://java.sun.com/jsf/html"
                template="/WEB-INF/templates/default.xhtml">

    <ui:define name="content">
        <h:form class="pull-left datepicker-fix">
            <ui:include src="employeeForm.xhtml" /><br/>
            <h:commandButton class="btn" action="#{employeeManager.createEmployee}" value="#{msg['form.add']}" />
        </h:form>
        <h:dataTable class="table table-striped table-bordered" value="#{deliveryBoys}" var="item" rendered="#{not empty deliveryBoys}">
            <h:column>
                <f:facet name="header">ID</f:facet>
                <h:outputText value="#{item.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header"><h:outputText value="#{msg['name']}"/></f:facet>
                <h:outputText value="#{item.name}"/>
            </h:column>
            <h:column>
                <f:facet name="header"><h:outputText value="#{msg['employee.birthDate']}"/></f:facet>
                <h:outputText value="#{item.birthDate}" >
                    <f:convertDateTime dateStyle="medium" type="date" />
                </h:outputText>    
            </h:column>
            <h:column>
                <f:facet name="header"><h:outputText value="#{msg['employee.role']}"/></f:facet>
                <h:outputText value="#{msg[item.role]}" />
            </h:column>
            <h:column>
                <f:facet name="header"><h:outputText value="#{msg['employee.password']}"/></f:facet>
                <h:outputText value="#{item.password}" />
            </h:column>
            <h:column>
                <f:facet name="header"><h:outputText value="#{msg['actions']}"/></f:facet>
                <h:button class="btn" outcome="employeeEdit" value="#{msg['form.edit']}">
                    <f:param name="id" value="#{item.id}" />
                </h:button>
            </h:column>
        </h:dataTable>
    </ui:define>
</ui:composition>

